package com.foreknow.demo26;

import java.util.ArrayList;
import java.util.List;

/**
 * 一、录入5次学生的信息,并将以下信息写到一个文件中(Students.txt)
 * 编号  姓名   学校   电话号码
 * 1    tom1  fore   121212121212  student对象
 * 2    tom2  fore   121212121212  student对象
 * 3    tom3  fore   121212121212  student对象
 * 4    tom4  fore   121212121212  student对象
 * 5    tom5  fore   121212121212  student对象
 *
 * 二、要从文件中读取到学生的信息并在控制台输出
 *
 * 思路分析
 * 1.面向对象的思想要先找到类
 * 学生类：属性(id  name  school  phone)
 * 功能类：读、写 的方法
 * 测试类: main方法
 *
 * 2.根据需求我要使用：字符流  处理流  BufferedReader和BufferedWriter
 *
 * 3.读和写的方法如何定义
 */
public class Test {
    public static void main(String[] args) {
        List<Student> list = new ArrayList<>();
        Student stu1 = new Student(1,"tom1","fore","121212121212");
        Student stu2 = new Student(2,"tom1","fore","121212121212");
        Student stu3 = new Student(3,"tom1","fore","121212121212");
        Student stu4 = new Student(4,"tom1","fore","121212121212");
        Student stu5 = new Student(5,"tom1","fore","121212121212");
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        list.add(stu4);
        list.add(stu5);
        ReadWrite rd = new ReadWrite();
        //存信息
//        rd.Write(list);

        //读信息
        rd.Read();

    }

}